{template 'common/header'}
{if IMS_VERSION<1}
    <link href="{MODULE_URL}/template/static/css/wq1.0.css" rel="stylesheet">
{/if}
<style>

    .setvotestatus{cursor:pointer;}
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{
        white-space: normal;
        word-wrap: break-word;
    }
</style>
<div class="main1">
    <div class="we7-page-title">所有会员</div>
    <table class="table we7-table table-hover">
        <thead class="navbar-inner">
        <tr>
            <th>openid</th>
            <th width="100">头像</th>
            <th>昵称</th>
            <th>收入</th>
            <th>当前所属分组</th>
        </tr>
        </thead>
        <tbody>
        {loop $list $row}
            <tr>
                <td class="text-left vertical-middle">{$row['oauth_openid']}</td>
                <td class="text-left vertical-middle"><img src="{$row['avatar']}" width="48"></td>
                <td>{$row['nickname']}</td>
                <td>{$row['prize']}元</td>
                <td class="text-left vertical-middle">
                    <select onchange="set_parent({$row['id']},this)">
                        <option value="0">未选择</option>
                    {loop $group $gv}
                        <option {if $row['group_id'] == $gv['id']} selected {/if}value="{$gv['id']}">{$gv['nickname']}</option>
                    {/loop}
                    </select>
                </td>
            </tr>
        {/loop}
        </tbody>
    </table>
    <div class="pull-right">
        {$pager}
    </div>
    <script>
        function set_parent(id,obj){
            var parent = $(obj).val();
            var url =  '{php echo $this->createWebUrl('set_leader')}';
            $.post(url,{uid:id,pid:parent}, function(data){
            }, 'json');
        }
    </script>

{template 'common/footer'}